package com.laixu.estore.service;

import com.laixu.estore.bean.pojo.Address;
import com.laixu.estore.bean.vo.AddressVo;
import com.laixu.estore.dao.AddressDao;
import com.laixu.estore.util.BeanCopyUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: vanse(lc)
 * @Date: 2025/4/11-04-11-11:29
 * @Description：com.briup.estore.web.controller
 */
@Service
@RequiredArgsConstructor
public class AddressService {
    private final AddressDao addressDao;

    public List<AddressVo> findAddresses(int userId) {
        List<Address> address = addressDao.findAddresses(userId);
        List<AddressVo> addressVos = BeanCopyUtils.copyBeanList(address, AddressVo.class);
        return addressVos;
    }
}